home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-10-08 | 14.8 KB | 369 lines | [TEXT/MPS ] |
- //
- // example.r
- //
- //
- // This example is intended as a guideline for working with the
- // rest of the examples included with the Installer SDK. This
- // example, using the InstaCompOne compression/decompression,
- // installs one copy of a SimpleText file called "Example File"
- // to a folder named "Example Example" on the selected target volume.
- //
- // To use any one of the examples, launch MPW ( Macintosh Programmer's
- // Workshop ), and set the current working directory to the folder
- // containing the example you are working on.
- //
- // Most MPW configurations include a "Directory" menu. You may choose
- // the current working directory by choosing "Set Directory…" from
- // the "Directory" menu.
- //
- // Each installation example includes a source script for the install
- // script to be included with the installation disks. This source script
- // is an MPW text file, and is always named with a ".r" extension. For
- // this example the source script is named "Example.r".
- //
- // Also included in each example is a build script in makefile form.
- // This makefile is an MPW text file, and is named "makefile" in all
- // the examples. This makefile is called when you tell MPW to build
- // the installation script to be included with the installation disks.
- //
- // Each example also includes the compiled ( actually rezzed ) script
- // that will be placed on the installation disks. This "finished"
- // installer script will serve to "drive" the Installer application
- // on your installation disks. In this case the finished installer
- // script is named "Example".
- //
- // A debugger version of the finished installer script is also included
- // and is named by appending "w/ debugger" to the original finished
- // installer script. In this case it is called "Example w/ debugger".
- //
- //
- // How To Build the Script:
- //
- // To build installer script to include on installation disks, select
- // the "Build…" menu item from the "Build" menu. Enter the scriptName
- // without the .r extension, which in the case of this example would
- // be "Example". ( Do not include the double quotes )
- //
- // To build the Installer Debugger version of the installer script enter
- // the scriptname with the addition ".debug", which in this case would
- // be "Example.debug". ( Do not include the double quotes )
- //
- // If you are using InstaCompOne compression or splitting:
- //
- // You must also include a copy of the file "InstaCompOneSCExt.rsrc"
- // that has been renamed to "fileCompress.scx". This file can be found
- // inside the folder "Tools:Released:InstaCompOne 1.1:" included in the SDK.
- // The renamed file is a ScriptCheck extension that will add functionality
- // to ScriptCheck for dealing with InstaCompOne archives. For your
- // convenience, a copy of this renamed file will be placed in this folder
- // when the makefile is run by the "Build" command.
- //
- // Running the installation examples:
- //
- // From your hard drive -
- //
- // The most convenient way to run the examples is to place a copy of
- // the Installer 4.0.3 application on your desktop. Then from within
- // the Finder, open the folder containing the example to try out, and
- // drag-drop the finished installer script onto the Installer 4.0.3
- // application on your desktop. This will allow you to run the examples
- // directly from the Installer SDK folders, rather than having to copy
- // files onto a diskette.
- //
- // From a diskette -
- //
- // Insert a diskette, and rename it to "Disk 1". Be sure this name
- // is entered correctly with a space. Take all the contents of
- // "Disk 1", which in this case is the "Tome" file. Also, you will
- // need to copy over the finished or rezzed installer script and a copy
- // of the Installer application. If you are going to run the debugger
- // version of the installer script be sure to copy over the debugger
- // version of the Installer application.
- //
- // NOTE: Some of the examples use copies of files (SimpleText or Example File) that
- // have been slightly modified, so be careful to use the actual copy of
- // the file from the specific example when preparing an installation diskette.
- //
- // Running the debugger version of the examples:
- //
- // Place a copy of the Debugger version of the Installer 4.0.3 application
- // on your desktop. Then drag-drop a debugger version of the finished
- // installer script onto the debugger version of the installer on the
- // desktop. The installer debugger will display information about the
- // progress of the installation in a window.
- //
- // To get even more out of the installer debugger, click in
- // the debugger window before actually beginning an installation. You
- // may then select from the two menus "Wasabi" and "Show" to select
- // different options for displayed information. Especially helpful are
- // the "Show" menu items "Frameworks", "Rules", and "Rules Clauses".
- // If the "Frameworks", "Rules", "Rules Clauses" are checked in the
- // debugger menu, then the analysis of rules is displayed each time
- // one of the rules frameworks is run. You can force this to happen
- // by selecting back and forth between Easy Install and Custom Install,
- // by clicking in the "Switch Disk" button, or by going to the Finder
- // and returning the the Installer application.
- //
- // NOTE: This example does not use installer frameworks or rule clauses
- // so it's probably not the best place to check out the debugger support
- // for checking out rules and frameworks from the debugger. For a good
- // example of rules and frameworks, try the "System Rules - Desk Accessory"
- // and "System Rules - Application" examples included with the SDK.
- //
- // Copyright 1994-1996, Apple Computer, Inc., All Rights Reserved
- //
-
- #include "InstallerTypes.r"
-
- // Include the InstaCompOne atom extender stuff
- // making sure not to add their version resource
- // to our installer script. Also, since this include
- // is a resource include instead of a #include, it is
- // not actually a pre-processor thing, and won't be effected
- // by a -i option within the rez line in the makefile.
- include ":::Tools:Released:InstaCompOne 1.1:InstaCompAtomExt.rsrc" NOT 'vers';
-
-
- // • packages
-
- // package that demonstrates simple case of InstaCompOne archive
- resource 'inpk' (100) {
- format0 {
- showsOnCustom, // This flag determines whether or not
- // the package will be visible as a
- // sub-package in Custom Install, otherwise
- // this flag is ignored when using 4.0
- // method of creating Custom Install
- // user selectable options.
-
- removable, // This flag determines whether or not
- // not the package should be listed in
- // Custom Install as removable, and whether
- // to remove this package when performing
- // a Custom Removal.
-
- dontForceRestart, // If any packages that are included in an
- // installation have this flag set to
- // 'forceRestart', then the user will be
- // forced to restart their computer
- // immediately after installation.
-
- 0, // Package comment ('inpc' or 'icmt' ) rsrc ID.
- // NOTE: usage of the new package comment
- // resource ( 'inpc' ), allows inclusion
- // of up to 32K of text to describe a package.
- // This extends the limit of 255 characters
- // of description text in the old style
- // 'icmt' package comments resource type.
-
- // For full demonstration of implementing
- // package comment resources, see the
- // 'Custom UI Example' included with
- // the Installer SDK examples.
-
- 0, // Total size of all files included in
- // this package. If value is zero, this
- // field will be filled by ScriptCheck.
- // NOTE: This field is not used during
- // checks for sufficient disk space, but
- // is displayed to user during Custom Install.
-
- "Example File to \"Example Example\" folder ( InstaCompOne compression )",
- // The description of the package when
- // displayed as a selectable option
- // in Custom Install and Custom Remove
- {
- 'infa', 1000; // List of all the items to be included
- // as part of this package. This list can
- // contain any of the atom resource types,
- // other package resources, or in the case
- // of a package being used as a divider line
- // this list can be empty.
- },
- }
- };
-
- // • file atoms
-
- resource 'infa' (1000) {
- format1 {
- deleteWhenRemoving, // Delete on deinstall
- deleteWhenInstalling, // Remove preexisting
- copy, // Copy on Install
- dontIgnoreLockedFile, // Respect file locking
- dontSetFileLocked, // Leave installed file unlocked
- useSrcCrDateToCompare, // Use creation date for compare
- srcNeedNotExist, // Create a new file if necessary
-
- // this line must be set to "rsrcForkInDataFork" when working
- // with file items compressed into InstaCompOne archives,
- // otherwise this flag should be set to 'rsrcForkInRsrcFork'
- rsrcForkInDataFork, // • Resource stuff in Data fork
-
- leaveAloneIfNewer, // On Easy Install, this causes
- // the target file to be preserved
- // if it is newer than the one
- // about to replace it. On Custom
- // Install this causes a dialog to
- // be displayed to the user asking
- // "Newer, Older, Cancel"
-
- updateExisting, // Update an existing file
- copyIfNewOrUpdate, // Copy whether target exists or not
- rsrcFork, // Copy resource fork
- dataFork, // Copy data fork
-
- 0, // TARGET - size ( filled in by ScriptCheck )
- 0x0, // finder attribute flags ( filled in by ScriptCheck )
- 10000, // TARGET - file spec ( 'intf' )
- {
- 10000, // SOURCE - file spec ( 'infs' )
- 0, // DATA fork - size ( filled in by ScriptCheck )
- 0 // RSRC fork - size ( filled in by ScriptCheck )
- },
-
- 0x0, // SOURCE - version number for comparisons
- // value of 0x0 specifies not to perform
- // version comparison
-
- 0, // 'invc' code resource - version comparison routine
- // ( none used here )
-
- 241, // 'inex' resource definition for atom extender
- // • #241 is for built in InstaCompOne extender
-
- "" // file atom description
- // ( Installer will use filename if blank )
- }
- };
-
-
- // • file specs
-
- // NOTE: Installer 4.0.3 supports both 'intf' and 'infs' resource types
- // as target file specs. It is recommended that 'intf' format1 be used.
-
- // target file spec
- resource 'intf' (10000) {
- format1 {
- noSearchForFile, // use default search path
-
- // NOTE: See the "Search Proc [insp]
- // Example" for an example of how to
- // override default search path
-
- // If the TypeCrNeedNotMatch flag is specified,
- // then the two fields of Type and Creator will be ignored
- // unless InstaCompOne compression is being used.
-
- // If the TypeCrMustMatch flag is specified, then
- // the installer will give an error message that the
- // target file cannot be replaced when the target
- // file's Type and Creator do not match those specified here.
-
- TypeCrNeedNotMatch, // target type and creator don't have to match
-
- 'ttro', // TYPE ( for file search if 'searchForFile' )
- 'ttxt', // CREATOR ( for file search if 'searchForFile' )
-
- // NOTE: If using InstaCompOne compression
- // these values are also used to
- // specify which compressed file within
- // an archive should be expanded during
- // installation of a file atom. ( see below )
-
-
- // The next three fields are provided so that the scriptwriter
- // can specify certain file information when creating a new file
- // or updating an existing one. If ScriptCheck fills in the values
- // it will use the values from the existing source file.
-
- 0x0, // Target - finder flags
- // ( ScriptCheck fills in flags if set to 0 )
-
- 1, // Target - creation date
- 1, // Target - mod date
- // ( ScriptCheck fills in dates set to 1 )
-
- 0, // 'insp' resource ID ( file search proc )
- // none used in this case
-
- // NOTE: the file search proc feature is
- // only supported with file atoms ( 'infa' )
- // and resource atoms ( 'inra' ). All other
- // atoms referencing an 'intf' with an 'insp'
- // reference will use the default file search
- // mechanism of the installer.
-
- ":Example Example:Example File" // path to target file
-
- // NOTE: when using InstaCompOne compression
- // the filename specified in the path to
- // target file ( along with the type and
- // creator specified above ) are used to
- // specify which file within the source archive
- // should be be decompressed. This filename,
- // type, and creator must match exactly those
- // of the compressed file item within the archive.
- // If ScriptCheck tells you there is a problem
- // #28202, then check the filename in the target
- // path, type, creator to be sure that they matche
- // filename, type, creator in the archive. You can
- // check the filename, type, creator in the archive
- // by using the command
- // [ InstaCompOneTool -o archiveName -L ] in MPW.
-
- }
- };
-
-
- // source file spec
- resource 'infs' (10000) {
- 'idcp', // TYPE of source file
- 'kakc', // CREATOR of source file
-
- // NOTE: When using InstaCompOne compression
- // for files ( as in this example ) these values
- // should always be used ( 'idcp' and 'kakc' ).
-
- // When using InstaCompOne compression for
- // resource items, the type should be 'ircp'
- // and the creator should be 'kakc'.
-
- // When not using InstaCompOne compression
- // these values should match those of your
- // source file.
-
- 0x1, // creation DATE for source file
- // value of zero matches any date
- // value of 1 filled by ScriptCheck
-
- noSearchForFile, // IGNORED in Installer 4.0.x
-
- TypeCrMustMatch, // TYPE, CREATOR must match file on install disk
-
- // NOTE: If 'TypeCrMustMatch' is used,
- // ScriptCheck will complain if type and
- // creator of source file do not match,
- // and an error will occur during installation.
-
- // If 'TypeCrNeedNotMatch' is used,
- // type and creator of source file will be
- // ignored.
-
- // When using InstaCompOne compression, this
- // fields should always be 'TypeCrMustMatch'
-
- "Disk 1:Tome" // PATH to source file
-
- // NOTE: When using InstaCompOne compression
- // this should be path to the archive containing
- // the file to be decompressed. The actual name
- // of the file to be decompressed is specified
- // in the target file spec ( 'intf' ).
-
- // When not using InstaCompOne compression
- // this should be path to the file to install.
- };
-
-